package org.dromara.comm.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.dromara.comm.domain.AsHome;
import org.dromara.comm.domain.AsHomeClassName;
import org.dromara.comm.service.AsHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 到家服务控制层
 *
 * @author: 郭伟明
 * @date: 2024-08-09 17:46
 **/
@RestController
@RequestMapping("/home")
@Tag(name = "到家服务控制层")
public class AsHomeController {


    @Autowired
    private AsHomeService asHomeService;

    @SaIgnore
    @Operation(summary = "查询到家服务")
    @GetMapping("/queryHome")
    public List<Map<String, Object>> queryHomeByClassName(AsHomeClassName asHomeClassName){
        return asHomeService.queryHomeByClassName(asHomeClassName);
    }


    @SaIgnore
    @Operation(summary = "添加到家服务")
    @PostMapping("/insertHome")
    public void insertHome(@RequestBody AsHome AsHome){
        asHomeService.insertHome(AsHome);
    }


    @SaIgnore
    @Operation(summary = "修改到家服务")
    @PostMapping("/updateHome")
    public void updateHome(@RequestBody AsHome AsHome){
        asHomeService.updateHome(AsHome);
    }
}

